package com.common.app.db

import androidx.room.*

/**
 * 作者：sosou
 * <p>
 * 版本：1.0
 * <p>
 * 创建日期：2022/8/21
 * <p>
 * 描述：上报事件Dao类
 * <p>
 * 修订历史：
 */
@Dao
interface ReportEventDao {

    @Insert
    fun insertEvent(vararg event: ReportEvent)

    @Delete
    fun deleteEvents(list: MutableList<ReportEvent>)

    @Query("select * from report_event where status != 1")
    fun findAll(): MutableList<ReportEvent>

    @Query("select count(*) from report_event where status != 1")
    fun count(): Int

    @Update
    fun updateEvent(event: ReportEvent)

    @Query("update report_event set status = 0 where status = 1")
    fun resetStatus()
}